package com.mxsoft.ssmdemo.mapper;

import com.mxsoft.ssmdemo.model.Foo;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
        "classpath*:/spring/applicationContext.xml",
        "classpath*:/mybatis/mybatis-config.xml",})
public class FooMapperTestCase {
    @Autowired
    FooMapper fooMapper;

    @Test
    public void testUpdate() {
        Foo foo = new Foo();
        foo.setId(1l);
        foo.setPassword("123456");

        int update = fooMapper.update(foo);

        Assert.assertEquals(1, update);

    }

}
